package day6.demo1_threadLocal;

import java.util.Random;

public class Mythread extends Thread{
    Book book;
    Random r;
    Mythread(String name,Book book,Random r){
        super(name);
        this.book = book;
        this.r = r;
    }

    @Override
    public void run() {
        this.book.setPageNo(r.nextInt(300));
        System.out.println(getName()+"读到第"+book.getPageNo()+"页");
    }
}
